package com.ucode.model.hrm.form;

import com.ucode.model.hrm.enums.HrmResignationTypeEnum;
import com.ucode.tool.validator.InEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.time.LocalDate;

@Schema(description = "人力资源管理系统 - 离职申请Form")
@Data
@EqualsAndHashCode
@ToString(callSuper = true)
public class HrmResignationApplyForm {

    /**
     * 员工ID
     */
    @Schema(description = "员工ID", requiredMode = Schema.RequiredMode.AUTO)
    private Long employeeId;
    /**
     * 拟离职日期
     */
    @Schema(description = "拟离职日期", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "拟离职日期不能为空")
    private LocalDate proposedLastWorkday;       // 拟离职日期

    /**
     * 实际离职日期
     */
    @Schema(description = "实际离职日期", requiredMode = Schema.RequiredMode.AUTO)
    private LocalDate actualLastWorkday;

    /**
     * 离职类型
     */
    @Schema(description = "离职类型", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "离职类型不能为空")
    @InEnum(value= HrmResignationTypeEnum.class)
    private Integer resignationType;

    /**
     * 离职原因详细说明
     */
    @Schema(description = "离职原因详细说明", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "离职原因详细说明不能为空")
    @Size(max = 500, message = "离职原因详细说明不能超过 500 个字符")
    private String reasonDetail;            // 离职原因详细说明
    /**
     * 工作交接详情
     */
    @Schema(description = "工作交接详情", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "工作交接详情不能为空")
    @Size(max = 500, message = "工作交接详情不能超过 500 个字符")
    private String handoverDetail;
    /**
     * 评价详情
     */
    @Schema(description = "评价详情", requiredMode = Schema.RequiredMode.AUTO)
    @Size(max = 500, message = "评价详情不能超过 500 个字符")
    private String evaluateDetail;

}
